import java.util.Scanner;

public class Main {

    //分巧克力
    //二分法

    public static int n;
    public static int k;
    public static int[][] a;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        n = scan.nextInt();
        k = scan.nextInt();
        a = new int[n][2];
        for (int i = 0; i < n; i++) {
            a[i][0] = scan.nextInt();
            a[i][1] = scan.nextInt();
        }
        int l = 1;
        int r = 100000;
        int ans = 1;
        while(l <= r){
            int mid = (l + r) / 2;
            if(check(mid) == 1){
                ans = mid;
                l = mid + 1;
            }else{
                r = mid - 1;
            }
        }
        System.out.println(ans);
    }

    private static int check(int x) {
        //在这个 x 的边长下我们最多能得到多少巧克力？
        long cnt = 0;
        //每一块巧克力能切成多少块小的
        for (int i = 0; i < n ; i++) {
            cnt += (long)(a[i][0] / x) * (long)(a[i][1] / x);
        }
        if(cnt >= (long)k){
            return 1;
        }else{
            return 0;
        }
    }


}
